<template>
  <div id="client">
    <p style="margin-left: 20px">
      <span class="demonstration" style="margin-left: 20px">单据日期：</span>
      <el-date-picker
        v-model="value2"
        type="daterange"
        align="right"
        unlink-panels
        range-separator="至"
        start-placeholder="开始日期"
        end-placeholder="结束日期"
        :picker-options="pickerOptions"
      >
      </el-date-picker>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 商品：<el-input
        style="width: 180px; margin-left: 10px; margin-right: 20px"
        placeholder="请输入商品"
        v-model="input"
        clearable
      ></el-input>
      <el-button
        style="margin-left: -20px; margin-right: 10px"
        @click="dialogFormVisible = true"
        >...</el-button
      >
      &nbsp;&nbsp;&nbsp; 客户：<el-input
        style="width: 180px; margin-left: 10px; margin-right: 20px"
        placeholder="请输入客户"
        v-model="input"
        clearable
      ></el-input>
      <el-button
        style="margin-left: -20px; margin-right: 10px"
        @click="dialogFormVisible = true"
        >...</el-button
      >
      &nbsp;&nbsp;&nbsp;
      <el-button type="primary">查询</el-button>
    </p>
    <p style="margin-top: 20px; margin-left: 40px">
      销售人员：<el-input
        style="width: 180px; margin-left: 10px; margin-right: 20px"
        placeholder="请输入销售人员"
        v-model="input"
        clearable
      ></el-input>
      <el-button
        style="margin-left: -20px; margin-right: 10px"
        @click="dialogFormVisible = true"
        >...</el-button
      >
    </p>
    <p style="text-align: center; margin-top: 20px; width: 100%">
      <span style="font-weight: bolder; font-size: 22px">商品销售明细表</span>
      <span style="display: inline-block; float: right">
        <el-button>导出</el-button>
        <el-button>打印</el-button>
      </span>
      <el-divider style="width: 1500px"></el-divider>
    </p>
    <el-table :data="tableData" border style="width: 100%">
      <el-table-column prop="id" label="商品编号" width="150px">
      </el-table-column>
      <el-table-column prop="name" label="商品名称" width="150px">
      </el-table-column>
      <el-table-column prop="type" label="规格型号" width="150px">
      </el-table-column>
      <el-table-column prop="brand" label="品牌" width="150px">
      </el-table-column>
      <el-table-column prop="dw" label="基本单位" width="150px">
      </el-table-column>
      <el-table-column prop="orderDate" label="订单日期" width="150px">
      </el-table-column>
      <el-table-column prop="sellid" label="销售订单编号" width="150px">
      </el-table-column>
      <el-table-column prop="sellman" label="销售人员" width="150px">
      </el-table-column>
      <el-table-column prop="kehu" label="客户" width="150px">
      </el-table-column>
      <el-table-column prop="ck" label="仓库" width="150px"> </el-table-column>
      <el-table-column prop="status" label="状态" width="150px">
      </el-table-column>
      <el-table-column prop="num" label="基本数量" width="150px">
      </el-table-column>
      <el-table-column prop="price" label="单价" width="150px">
      </el-table-column>
      <el-table-column prop="sellmoney" label="销售额" width="150px">
      </el-table-column>
      <el-table-column prop="nogonum" label="未出库基本数量" width="150px">
      </el-table-column>
      <el-table-column prop="nogomoney" label="未出库金额" width="150px">
      </el-table-column>
      <el-table-column prop="deliverydate" label="预计交货日期" width="150px">
      </el-table-column>
      <el-table-column prop="godate" label="最后出库日期" width="150px">
      </el-table-column>
      <el-table-column prop="doman" label="制单人" width="150px">
      </el-table-column>
      <el-table-column prop="text" label="备注" width="150px">
      </el-table-column>
    </el-table>
    <div style="width: 100%; background-color: blanchedalmond; height: 30px">
      <table style="width: 78.7%; height: 30px">
        <tr>
          <td style="width: 50%">合计：</td>
          <td style="width: 50%">123</td>
        </tr>
      </table>
    </div>
    <div class="block">
      <p style="text-align: center; margin-top: 10px">
        <el-pagination
          @size-change="handleSizeChange"
          @current-change="handleCurrentChange"
          :current-page="currentPage1"
          :page-sizes="[100, 200, 300, 400]"
          :page-size="100"
          layout="total, sizes, prev, pager, next, jumper"
          :total="400"
        >
        </el-pagination>
      </p>
    </div>
  </div>
</template>

<script>
export default {
  name: "SalesOrderTracking",
  data() {
    return {
      currentPage1: 5,
      tableData: [
        {
          id: "G001",
          name: "苹果iPhone 14",
          type: "A2468",
          brand: "苹果",
          dw: "台",
          orderDate: "2024-01-01",
          sellid: "SO001",
          sellman: "销售员A",
          kehu: "客户甲",
          ck: "仓库A",
          status: "已下单",
          num: 100,
          price: 5000,
          sellmoney: 500000,
          nogonum: 20,
          nogomoney: 100000,
          deliverydate: "2024-02-01",
          godate: "2024-01-15",
          doman: "张三",
          text: "紧急订单，请优先处理",
        },
        {
          id: "G002",
          name: "华为Mate 50",
          type: "B1234",
          brand: "华为",
          dw: "台",
          orderDate: "2024-01-02",
          sellid: "SO002",
          sellman: "销售员B",
          kehu: "客户乙",
          ck: "仓库B",
          status: "待发货",
          num: 50,
          price: 4500,
          sellmoney: 225000,
          nogonum: 10,
          nogomoney: 45000,
          deliverydate: "2024-02-10",
          godate: "2024-01-20",
          doman: "李四",
          text: "客户要求开具增值税发票",
        },
        {
          id: "G003",
          name: "三星Galaxy S23",
          type: "C3456",
          brand: "三星",
          dw: "台",
          orderDate: "2024-01-03",
          sellid: "SO003",
          sellman: "销售员C",
          kehu: "客户丙",
          ck: "仓库C",
          status: "已发货",
          num: 200,
          price: 6000,
          sellmoney: 1200000,
          nogonum: 5,
          nogomoney: 30000,
          deliverydate: "2024-02-15",
          godate: "2024-01-25",
          doman: "王五",
          text: "注意：易碎品，小心轻放",
        },
        {
          id: "G004",
          name: "小米12S Ultra",
          type: "D4567",
          brand: "小米",
          dw: "台",
          orderDate: "2024-01-04",
          sellid: "SO004",
          sellman: "销售员D",
          kehu: "客户丁",
          ck: "仓库D",
          status: "已完成",
          num: 150,
          price: 3500,
          sellmoney: 525000,
          nogonum: 0,
          nogomoney: 0,
          deliverydate: "2024-02-20",
          godate: "2024-01-30",
          doman: "赵六",
          text: "客户要求提供售后服务",
        },
      ],
      dialogFormVisible: false,
      value2: "",
    };
  },
  methods: {
    goto(to) {
      if (this.$route.path !== "/" + to) {
        this.$router.push(to);
      }
    },
    handleSizeChange(val) {
      console.log(`每页 ${val} 条`);
    },
    handleCurrentChange(val) {
      console.log(`当前页: ${val}`);
    },
  },
};
</script>

<style scoped>
.el-button el-button--default el-popover__reference {
  margin-right: 20px;
}

tr {
  border: 1px solid black;
}
</style>